/* 自定义导航 */
.header{ position: sticky; top: 0; z-index: 10; }
.header-inner{
  height: 88rpx; display:flex; align-items:center; justify-content:center;
  color:#111; font-weight:600; font-size:32rpx; position:relative;
}
.back{ position:absolute; left:24rpx; font-size:44rpx; line-height:1; }
.slot{ position:absolute; right:24rpx; width:120rpx; height:1rpx; }
.title{ letter-spacing: 1rpx; }

/* 内容滚动容器 */
.body{
  position: relative; z-index: 1;
  height: calc(100vh - 88rpx - 120rpx - env(safe-area-inset-bottom));
  padding: 16rpx 24rpx 24rpx;
  box-sizing: border-box;
}

/* 欢迎语 */
.welcome{ display:flex; align-items:flex-start; gap:24rpx; margin-top: 24rpx; }
.avatar{ width: 96rpx; height:96rpx; border-radius:50%; box-shadow:0 4rpx 12rpx rgba(0,0,0,.08); }
.hello{ font-size:36rpx; line-height:1.5; color:#1f2329; font-weight:700; }
.hello-line{ display:block; }

/* 卡片 */
.card{
  margin-top: 24rpx; background:#fff; border-radius: 24rpx;
  box-shadow: 0 12rpx 36rpx rgba(16,24,40,.12);
  padding: 0 24rpx 8rpx;
}
.card-hd{
  height: 96rpx; display:flex; align-items:center; justify-content:space-between;
}
.card-title{ font-size: 32rpx; font-weight: 700; color:#1f2329; }
.switch{ display:flex; align-items:center; gap:8rpx; color:#4c82ff; }
.icon{ transform: rotate(0deg); }
.switch-text{ font-size: 28rpx; }
.divider{ height:2rpx; background:#edf0f5; }

/* 三行列表：左对齐，行间距与设计一致 */
.card-body{ padding:10rpx 20rpx 16rpx; }
.q-item{
  font-size:30rpx; color:#192940; line-height:48rpx;
  padding:8rpx 0;
}
.q-item:active{ background:#f6f8ff; border-radius:10rpx; }
.divider{ height:1rpx; background:#eef1f6; transform:scaleY(.5); transform-origin:0 0; }


/* ====== 对话区 ====== */
.chat-list {
  margin-top: 24rpx;
  margin-bottom: 50rpx;
  display: flex;
  flex-direction: column;
  gap: 20rpx;
}

/* 行容器：头像要和气泡“顶对齐” */
.msg-row {
  display: flex;
  align-items: flex-start;   /* 顶端对齐，关键 */
  gap: 16rpx;
}

/* 用户消息靠右 */
.msg-row.user {
  justify-content: flex-end;
}

/* 头像（助手） */
.avatar-chat {
  width: 64rpx;
  height: 64rpx;
  border-radius: 50%;
  box-shadow: 0 8rpx 20rpx rgba(0,0,0,.08);
  align-self: flex-start;    /* 再保险顶对齐 */
}

/* 气泡通用 */
.bubble {
  max-width: 72vw;
  padding: 16rpx 22rpx;
  font-size: 30rpx;
  line-height: 1.65;
  word-break: break-word;
  border-radius: 22rpx;
}

/* 助手气泡：白底、轻阴影，左下角更圆一点 */
.msg-row.assistant .bubble {
  background: #ffffff;
  color: #1a1f2b;
  box-shadow: 0 12rpx 36rpx rgba(16,24,40,.10);
  border-radius: 22rpx 22rpx 22rpx 10rpx; /* 左下略小，形似“尾巴” */
}

/* 用户气泡：右侧蓝色、白字，右下角略小 */
.msg-row.user .bubble {
  background: #2f89ff;
  color: #ffffff;
  box-shadow: 0 12rpx 36rpx rgba(47,137,255,.20);
  border-radius: 22rpx 22rpx 10rpx 22rpx; /* 右下略小，和设计一致 */
}



/* ===== 底部输入胶囊 + 蓝色发送 ===== */
.input-bar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: 12rpx 24rpx calc(env(safe-area-inset-bottom) + 12rpx);
  background: transparent;     /* 如果需要底色可改为 #f6f8fb/半透明 */
  backdrop-filter: blur(6px);
}
.input-wrap{
  height:88rpx; display:flex; align-items:center;
  background:#fff; border:1rpx solid #e6ecf5; border-radius:999rpx;
  padding:0 10rpx 0 18rpx; box-shadow:0 8rpx 20rpx rgba(18,55,112,.06);
}
.input{ flex:1; height:88rpx; line-height:88rpx; font-size:30rpx; color:#0f172a; }
.input::placeholder{ color:#9aa4b2; }
/* 发送按钮：绝对定位在输入框右侧，垂直居中 */
.send-btn{ background: none; padding: 0; }
.send-icon{ width: 48rpx; height: 48rpx; border-radius: 50%; }

/* 复用你已有的 .msg-row/.avatar/.bubble 样式，这里只补动画 */

.spinner {
  width: 28rpx; height: 28rpx; border-radius: 50%;
  border: 4rpx solid rgba(47,137,255,.25);
  border-top-color: #2f89ff;
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 12rpx;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-text { vertical-align: middle; color:#4b5563; }

.thinking-dots { display: inline-flex; gap: 8rpx; margin-right: 12rpx; }
.dot {
  width: 8rpx; height: 8rpx; border-radius: 50%; background:#9dbfff;
  animation: blink 1.2s infinite ease-in-out;
}
.dot:nth-child(2){ animation-delay: .2s; }
.dot:nth-child(3){ animation-delay: .4s; }
@keyframes blink {
  0%, 80%, 100% { opacity: .2; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4rpx); }
}


.reasoning-badge .badge{
  background:#f6f8ff;
  border:1rpx dashed #9dbfff;
  color:#1f2a44;
  padding:12rpx 16rpx;
  border-radius:14rpx;
  font-size:26rpx;
}
.badge-text{ opacity:.9; }
.dashed-divider {
  margin: 10rpx 0 12rpx 0;
  border-bottom: 2rpx dashed rgba(0,0,0,0.15);
}
.fold-body .mono {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 26rpx;
  line-height: 1.6;
  color: #667085;
}
.answer { white-space: pre-wrap; }

.fold-icon {
  width: 28rpx;
  height: 28rpx;
  margin-bottom: 8rpx;
  margin-left: 8rpx;
  vertical-align: middle;
}
.action-bar {
  margin-top: 12rpx;
  display: flex;
  gap: 16rpx;
  flex-wrap: wrap;
  opacity: 0.96;
}

.action-bar .action {
  line-height: 1;
  padding: 12rpx 20rpx;
  border-radius: 9999rpx;
  font-size: 24rpx;
  background: #f5f7fa;
}

.msg-ai .bubble {
  white-space: pre-wrap;
}

.bubble-dim {
  opacity: 0.6;
}
/* 行容器是左右结构：头像 + 文本区（bubble/action-wrap） */
.msg-row {
  display: flex;
  align-items: flex-start;
}

/* 头像宽度和与气泡的水平间距（按你的实际为准） */
.msg-row .avatar {
  width: 64rpx;
  height: 64rpx;
  margin-right: 16rpx;
  border-radius: 50%;
}

/* 气泡建议限定最大宽度，避免过长换行影响布局 */
.msg-row .bubble {
  max-width: 75%;
}
/* 行容器是左右结构：头像 + 文本区（bubble/action-wrap） */
.msg-row {
  display: flex;
  align-items: flex-start;
}

/* 头像宽度和与气泡的水平间距（按你的实际为准） */
.msg-row .avatar {
  width: 64rpx;
  height: 64rpx;
  margin-right: 16rpx;
  border-radius: 50%;
}

/* 气泡建议限定最大宽度，避免过长换行影响布局 */
.msg-row .bubble {
  max-width: 75%;
}

/* 让操作区“独占下一行”，并与气泡左边缘对齐 */
.action-wrap {
  flex-basis: 100%;          /* 强制换到下一行 */
  width: 100%;
  display: flex;
  /* 左缩进 = 头像宽度 + 头像与气泡的间距 */
  margin-left: calc(64rpx + 16rpx);
  margin-top: 12rpx;
}







/* 气泡里的浅灰实线 */
.bubble-hr {
  height: 1px;
  background: #eaeaea;
  margin: 20rpx 0 16rpx 0;
}

/* 气泡内按钮行：左三右一 */
.bubble-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24rpx;
}
.actions-left { display: flex; gap: 20rpx; }
.actions-right { display: flex; }

/* 圆角淡底的图标按钮 */
.icon-btn {
  width: 70rpx; height: 70rpx;
  background: #ecf3ff;
  border-radius: 24rpx;
  display: flex; justify-content: center; align-items: center;
}
.icon-img { width: 35rpx; height: 35rpx; }





/* 页面底部预留 */
.flex-blank{ height: 40rpx; }
